package com.ale.oxetool;


public class Main {

//    static void testXmlBinding(){
//        Data d = new Data();
//        d.setErrorCode(1);
//        d.setErrorMessage("报文解析错误");
//
//        try {
//            JAXBContext jaxbDataContext = JAXBContext.newInstance(Data.class);
//            Marshaller jaxbMarshaller = jaxbDataContext.createMarshaller();
//            jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
//            jaxbMarshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
//            jaxbMarshaller.marshal(d, System.out);
//
//            Unmarshaller jaxbDataUnMarshaller = jaxbDataContext.createUnmarshaller();
//            Data d2 = (Data) jaxbDataUnMarshaller.unmarshal(new StringSource("<data>\n" +
//                    "    <errorCode>0</errorCode>\n" +
//                    "    <errorMessage>内部错误</errorMessage>\n" +
//                    "</data>"));
//            System.out.println(d2.getErrorMessage());

//            JAXBContext jaxbOrderContext = JAXBContext.newInstance(ORDER.class);
//            Unmarshaller jaxbOrderUnMarshller= jaxbOrderContext.createUnmarshaller();
//            String text="<ORDER>\n" +
//                    "                <servicecode>0103005</servicecode>\n" +
//                    "                <source>01</source>\n" +
//                    "                <target>12101</target>\n" +
//                    "                <data>\n" +
//                    "                    <number>70450</number>\n" +
//                    "                    <platform>02</platform>\n" +
//                    "                </data>\n" +
//                    "            </ORDER>";
//
//            ORDER order = (ORDER) jaxbOrderUnMarshller.unmarshal(new StringSource(text));
//            System.out.println(order.getData().getPlatform());
//        } catch (JAXBException e) {
//            e.printStackTrace();
//        }
//    }

    public static void main(String[] args) {

    }
}
